package org.elsfs.cloud.common.mybatis.ext.sql.support.condition;


import org.elsfs.cloud.common.util.lang.NamingCase;

/**
 * 不在字段区间条件
 *
 */
public class NotBetweenFieldConditionItem extends BetweenFieldConditionItem {

    public NotBetweenFieldConditionItem(String leftField, String beginField, String endField) {
        super(leftField, beginField, endField);
    }

    /**
     * 构建SQL片段
     *
     * @return SQL片段
     */
    @Override
    public String buildSqlFragment() {
        return String.format(
            "%s NOT BETWEEN %s AND %s",
            NamingCase.toUnderlineCase(this.leftField),
            NamingCase.toUnderlineCase(this.beginField),
            NamingCase.toUnderlineCase(this.endField)
        );
    }
}
